package com.czy.workflow.core.service;

import com.czy.workflow.core.model.*;

import java.util.List;

public interface FlowService {

    boolean saveFlowMain(FlowMain flowMain);

    FlowMain getFlowMainById(String flowId);

    FlowNode getFlowNodeById(String flowId, String nodeId);

    List<FlowNode> getNextNodes(String flowId, String nodeId);

    List<FlowBranch> getNodeBranches(String flowId, String nodeId);

    List<FlowNode> getStartNodes(String flowId);

    boolean refreshCurrentNodes(String docId, String currentNodeId,  List<FlowNode> nextNodes);

    boolean clearCurrentNodes(String docId);

    boolean existCurrentNode(String docId, String currentNodeId);

    /**
     * 任务的当前节点
     * @description 需要根据用户筛选
     * @param docId
     * @return
     */
    List<FlowNode> getCurrentNodes(String docId);

    FlowOrgElement getCurrentUser();

    boolean saveFlowLog(TaskInfo taskInfo, boolean result);

    TaskInfo getTaskInfoByDocId(String docId, String nodeId);

    /**
     * 校验节点用户权限
     * @return
     */
    boolean validateNodeAuthority(TaskInfo taskInfo);
}
